package com.lagouedu.pojo;

import lombok.Data;

import java.util.HashMap;
import java.util.Map;

@Data
public class R extends HashMap {


    public static R ok(String msg){
        R r = new R();
        r.put("code", 200);
        r.put("msg", msg);
        return r;
    }

    public static R error(String msg){
        R r = new R();
        r.put("code", 500);
        r.put("msg", msg);
        return r;
    }

    public R put(String key,Object value){
        super.put(key,value);
        return this;
    }
}
